package com.zelin.dao.staticproxy;

import com.zelin.dao.UserDao;
import com.zelin.dao.impl.UserDaoImpl;

/**
 * ------------------------------
 * 功能：静态代理
 * 作者：WF
 * 微信：hbxfwf13590332912
 * 创建时间：2021/10/13-14:34
 * ------------------------------
 */
public class UserDaoStaticProxyImpl implements UserDao {

    //引入目标对象
    private UserDao userDao;
    public UserDaoStaticProxyImpl(){
        userDao = new UserDaoImpl();
    }

    @Override
    public void add() {
        userDao.add();
    }

    @Override
    public void update() {
        userDao.update();
    }

    @Override
    public void delete() {
        userDao.delete();
    }

    @Override
    public void query() {
        checkSecurity();
        userDao.query();
    }

    private void checkSecurity(){
        System.out.println("进行安全性检查...");
    }
}
